package cn.howxu.yichen_ovo.registry;

import cn.howxu.yichen_ovo.Res;
import cn.howxu.yichen_ovo.YiChenOVO;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.IForgeRegistry;
import net.minecraftforge.registries.NewRegistryEvent;
import net.minecraftforge.registries.RegistryBuilder;
import cn.howxu.yichen_ovo.registry.api.PaintingType;

import java.util.function.Supplier;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = YiChenOVO.MODID)
public class PaintingTypeRegistry {
	// 注册一种特殊类型
	public static final ResourceLocation registryLocation = Res.rl( "painting");
	public static Supplier<IForgeRegistry<PaintingType>> PAINTINGS;

	@SubscribeEvent
	public static void onNewRegistry(NewRegistryEvent event) {
		RegistryBuilder<PaintingType> registryBuilder = new RegistryBuilder<>();
		registryBuilder.setName(registryLocation);
		PAINTINGS = event.create(registryBuilder);
	}
}